<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     enterprise_default
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */
?>
<?php if ($this->canShow() && $this->getEvents() && count($this->getEvents())): ?>
    <h2 class="table-caption"><?php echo Mage::helper('enterprise_customerbalance')->__('Balance History'); ?></h2>
    <table id="customerbalance-history" class="data-table">
        <col />
        <col width="100" />
        <col width="100" />
        <col width="150" />
        <thead>
            <tr>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Action'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Balance Change'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Balance'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Date'); ?></th>
            </tr>
        </thead>
        <?php foreach ($this->getEvents() as $event): ?>
        <tbody>
            <tr>
                <td><?php echo $this->getActionLabel($event->getAction()); ?></td>
                <td><?php echo Mage::helper('core')->currency($event->getBalanceDelta()); ?></td>
                <td><?php echo Mage::helper('core')->currency($event->getBalanceAmount()); ?></td>
                <td><?php echo Mage::helper('core')->formatDate($event->getUpdatedAt(), 'short', true); ?></td>
            </tr>
        </tbody>
        <?php endforeach; ?>
    </table>
    <script type="text/javascript">decorateTable('customerbalance-history')</script>
<?php endif; ?>
